package com.xoa.controller.party;


import com.xoa.model.party.InspectorProblem;
import com.xoa.service.party.InspectorProblemService;
import com.xoa.util.common.wrapper.BaseWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by 程叶同 on 2018/1/6.
 */
@Controller
@RequestMapping("inspectorProblem")
public class InspectorProblemController {
    @Autowired
    InspectorProblemService inspectorProblemService;

    @RequestMapping("/addProblem")
    @ResponseBody
    public BaseWrapper addProblem(HttpServletRequest request, InspectorProblem inspectorProblem){
        return inspectorProblemService.addProblem(inspectorProblem);
    }

    @RequestMapping("/deleteProblem")
    @ResponseBody
    public BaseWrapper deleteProblem(HttpServletRequest request, Integer id){
        return inspectorProblemService.deleteProblem(request,id);
    }
    @RequestMapping("/getProblemList")
    @ResponseBody
    public BaseWrapper getProblemList(HttpServletRequest request, Integer page, Integer pageSize, String subcounty, String unitName){
        return inspectorProblemService.getProblemList(request,page,pageSize,subcounty,unitName);
    }
    @RequestMapping("/updateProblem")
    @ResponseBody
    public BaseWrapper updateProblem(HttpServletRequest request, InspectorProblem inspectorProblem){
        return inspectorProblemService.updateProblem(request,inspectorProblem);
    }
    @RequestMapping("/getInspectorById")
    @ResponseBody
    public BaseWrapper getInspectorById(HttpServletRequest request, Integer id){
        return inspectorProblemService.getInspectorById(id);
    }
    @RequestMapping("/outPutFile")
    @ResponseBody
    public BaseWrapper outPutFile(HttpServletRequest request, HttpServletResponse response, String ids){
        return inspectorProblemService.outPutFile(request,response,ids);
    }
}
